package com.gzs.space.config;

import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.core.publisher.Mono;

/**
 * @author GZS
 * @date 2022年05月15日
 */

@Configuration
public class KeyResolverConfiguration {

	/**
	 * 限流规则
	 * @return
	 */
	@Bean
	public KeyResolver pathKeyResolver(){
		return exchange -> Mono.just(exchange.getRequest().getURI().getPath());
	}
}
